local M={}

function M:Awake()
    Alice.Console.Debug("ImageSprite Awake")
    self.GameObject:SetName("ImageSprite")
    self.is=self.GameObject:GetComponent(Alice.ImageSprite)
    self.is:SetColor(255,255,255,255)
    self.is:SetMaterial("NewMaterial.material")
    self.is:SetSize(40,40)
    local w,h=self.is:GetSize()
    Alice.Console.Debug("image sprite size ",w,h,self.is:GetMaterial())
    self.GameObject:SetPosition(-200,0,0)
    self.GameObject:AddComponent(Alice.Physics2DComponent)
end

function M:Update(delta)
    local x,y,z=self.GameObject:GetPosition()
    x=x+delta*10
    self.GameObject:SetPosition(x,y,z)
end

function M:OnCollideBegin(other)
    Alice.Console.Debug("OnCollideBegin",other:GetName())
end

function M:OnCollideEnd(other)
    Alice.Console.Debug("OnCollideEnd",other:GetName())
end

return M